import request from "./request.js"

export const getTodayHealthData = (userId) => {
    return request({
        url: '/health/today',
        method: 'GET',
        data:{
            userId: userId
        }
    })
}

export const submitHealthData = (form) => {
    return request({
        url: '/health/submit',
        method: 'POST',
        data:{
            userId: form.userId,
            bloodPressure: form.bloodPressure,
            bloodSugar: form.bloodSugar,
            sleepDuration: form.sleepDuration,
            steps: form.steps,
            calorie: form.calorie,
            waterIntake: form.waterIntake,
            weight: form.weight
        },
        headers: {
            'Content-Type': 'application/json'
        },
    })
}

export const getLastSevenDaysHealthData = (userId) => {
    return request({
        url: '/health/last-seven-days',
        method: 'GET',
        params:{
            userId: userId
        }
    })
}

export const getAllHealthData = () => {
    return request({
        url: '/health/all',
        method: 'GET',
    })
}